package com.meals.system.dao;

import com.meals.system.entity.WhitesMealShoppingCartItem;
import com.meals.system.util.PageQueryUtil;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * Description:
 * Parm:
 * return:
 * Author: Chen
 * Date: 2021/12/13
 */
@Mapper
public interface WhitesMealShoppingCartItemMapper {

    WhitesMealShoppingCartItem selectByPrimaryKey(Long cartItemId);

    // 获取某用户购物车内某个商品的信息
    WhitesMealShoppingCartItem selectByUserIdAndGoodsId(@Param("userId") Long userId, @Param("goodsId") Long goodsId);

    // 获取某用户购物车的所有商品信息
    List<WhitesMealShoppingCartItem> selectByUserId(@Param("userId") Long userId, @Param("number") int number);

    List<WhitesMealShoppingCartItem> selectByUserIdAndCartItemIds(@Param("userId") Long userId, @Param("cartItemIds") List<Long> cartItemIds);

    int selectCountByUserId(Long userId);

    // 分页
    List<WhitesMealShoppingCartItem> findShoppingCartItems(PageQueryUtil pageUtil);

    int getTotalShoppingCartItems(PageQueryUtil pageUtil);



    int deleteBatch(List<Long> ids);

    int deleteByPrimaryKey(Long cartItemId);

    int insert(WhitesMealShoppingCartItem record);

    int insertSelective(WhitesMealShoppingCartItem record);

    int updateByPrimaryKey(WhitesMealShoppingCartItem record);

    int updateByPrimaryKeySelective(WhitesMealShoppingCartItem record);




}
